package tag

import (
	"github.com/labstack/echo"
	"maki/model"
	"maki/utils"
	"net/http"
)

func TagList(ctx echo.Context) error {
	var tags []model.Tag
	if status := model.DB.Find(&tags); status.Error != nil {
		return status.Error
	}

	return ctx.JSON(http.StatusOK, utils.NewResult(tags))
}
